package d0323;

public class Sheep {
    private String name;
    private int age;

    public Sheep(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static void main(String[] args) {
        Sheep s1=new Sheep("Alice",3);
        Sheep duoli= null;
        try {
            duoli = (Sheep) s1.clone();
            System.out.println("s1==duoli:"+(s1==duoli));
            System.out.println(duoli.name+"\t"+duoli.age);
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
    }
}
